/*
 * @Date         : 2024-03-01 20:58:35
 * @LastEditTime : 2024-09-09 17:45:35
 * @description  : api
 */
import request from "@/utils/request";

export function login(query) {
  return request({
    url: "/api/login",
    method: "post",
    data: query,
  });
}
export function getExamProblem(query) {
  return request({
    url: "/api/getExamProblem",
    method: "post",
    data: query,
  });
}
export function getExamInfo(query) {
  return request({
    url: "/api/getExamInfo",
    method: "get",
    query,
  });
}
export function getUserInfo(query) {
  return request({
    url: "/api/getUserInfo",
    method: "get",
    query,
  });
}
export function captcha(query) {
  return request({
    url: "/api/captcha",
    method: "get",
    query,
  });
}
// 交卷
export function subExam(query) {
  return request({
    url: "/api/subExam",
    method: "post",
    data: query,
  });
}
// 提交答案
export function subAnswer(query) {
  return request({
    url: "/api/subAnswer",
    method: "post",
    data: query,
  });
}
// 练习处方列表
export function getPrescription(query) {
  return request({
    url: "/api/getPrescription",
    method: "get",
    query,
  });
}
export function trainLog(query) {
  return request({
    url: "/api/trainLog",
    method: "post",
    data: query,
  });
}
export function autoSubTrainExam(query) {
  return request({
    url: "/api/autoSubTrainExam",
    method: "post",
    data: query,
  });
}
export function autoSubExam(query) {
  return request({
    url: "/api/autoSubExam",
    method: "post",
    data: query,
  });
}
export function subTrainAnswer(query) {
  return request({
    url: "/api/subTrainAnswer",
    method: "post",
    data: query,
  });
}
export function subTrainExam(query) {
  return request({
    url: "/api/subTrainExam",
    method: "post",
    data: query,
  });
}
export function getPrescriptionProblem(query) {
  return request({
    url: "/api/getPrescriptionProblem",
    method: "post",
    data: query,
  });
}
export function getExamDesc(query) {
  return request({
    url: "/api/getExamDesc",
    method: "get",
    query,
  });
}
export function getTrainExamProblem(query) {
  return request({
    url: "/api/getTrainExamProblem",
    method: "post",
    data: query,
  });
}
export function subTrainResult(query) {
  return request({
    url: "/api/subTrainResult",
    method: "post",
    data: query,
  });
}
export function checkOnlinet(query) {
  let examInfo = JSON.parse(sessionStorage.getItem("examInfo"));
  query = { ...examInfo, ...query };
  return request({
    url: "/api/checkOnline",
    method: "post",
    data: query,
  });
}
